<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
    <script type="text/javascript" src="idcode/jquery-1.11.1.min.js"></script>
    <script language="javascript" src="idcode/jquery.idcode.js"></script>
    <link type="text/css" rel="stylesheet" href="idcode/jquery.idcode.css" />
</head>
<body>
    <form action="#" method="post">
        <span id="idcode"></span><br/>
        <input type="button" onclick="fun()" value="登录"/>
    </form>
</body>
</html>
<script>
    $(document).ready(function(){
        $.idcode.setCode();
    });
    function fun(){
        var inp = document.getElementById("ehong-code-input").value;
        var d = document.getElementById("ehong-code").innerText;
        if(inp== d){
            alert("验证通过"+inp);
            document.forms[0].submit();
        }else{
            alert("验证不通过"+inp);
        }
    }
</script>